package com.hulk.dryad.manage.boot.upload2;

import cn.hutool.core.util.StrUtil;
import com.hulk.dryad.common.constant.CommonConstants;
import lombok.Getter;
import lombok.Setter;
import net.dreamlu.mica.core.utils.PathUtil;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.lang.Nullable;

/**
 * 文件上传配置
 *
 * @author hulk
 */
@Getter
@Setter
@ConfigurationProperties(prefix = DryadUploadProperties.PREFIX)
public class DryadUploadProperties {

	static final String PREFIX = "dryad.upload";
	/**
	 * 上传的文件 路径匹配
	 */
	private String uploadPathPattern = StrUtil.SLASH + CommonConstants.DEFAULT_UPLOAD_DIR + StrUtil.SLASH +"**";

	/**
	 * 文件保存目录，默认：jar 包同级目录
	 */
	@Nullable
	private String savePath = PathUtil.getJarPath() + StrUtil.SLASH + CommonConstants.DEFAULT_UPLOAD_DIR;

}
